package br.com.sgc.entities.geral;

import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.Table;

import br.com.sgc.entities.veterinaria.Animal;

@Entity
@Table(schema = "geral", name="paciente_animal")
public class PacienteAnimal extends Paciente{
	
	
	private static final long serialVersionUID = 5063688916819340045L;
	
	@ManyToOne(fetch = FetchType.LAZY)
	@JoinColumn(name = "animal_id")
	private Animal animal = new Animal();

	public Animal getAnimal() {
		return animal;
	}

	public void setAnimal(Animal animal) {
		this.animal = animal;
	}
	
	@Override
	public String getDisplayNome() {
		return animal.getNome();
	}
	
	@Override
	public String getDisplayDocumento() {
		return "Pedigree: "+animal.getNumeroPedigree();
	}

}
